home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 76 / MF_UK_76_1.iso / Education Feature / MicroWorlds 2.03 Try Me / MicroWorlds 2.03 Try Me.rsrc / TEXT_4012_! has no value.txt < prev    next >
Encoding:
Text File  |  1998-05-08  |  700 b   |  22 lines

  1. The variable name was used, but had not previously been assigned a value. Verify that the name used was correct (shownames displays the names of the variables in memory). A variable is given a value by naming it on the input line of a procedure, and with the make and name commands.
  2.  
  3. Example:
  4.  
  5. show :friends
  6. friends has no value
  7. make "friends [Ann Bob Mel Kim]
  8. show :friends
  9. Ann Bob Mel Kim
  10.  
  11. In a procedure, an undefined variable looks like this. This example shows a simple typing mistake:
  12.  
  13. to square :size
  14. repeat 4 [fd :side rt 90]
  15. end
  16.  
  17. If you try to run this procedure, MicroWorlds will say
  18.  
  19. side has no value in square
  20.  
  21. because the variable on the title line of the procedure is size, not side.
  22.